<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
	<title>消息管理</title>
</head>
<body>	
	
	<div class="main-content-inner">
	
		<div class="breadcrumbs" id="breadcrumbs">
			
			<script type="text/javascript">
				try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
			</script>
	
			<ul class="breadcrumb">
				<li>
					<i class="ace-icon fa fa-home home-icon"></i>
					<a href="${ctx}/welcome">主页</a>
				</li>
				<li class="active">消息</li>
			</ul>
			
			<div class="nav-search" id="nav-search">
				<form class="form-search" action="${ctx}/msguser/list" method="GET">
					<span class="input-icon">
						<input type="text" autocomplete="off" name="search_LIKE_name" placeholder="名称 ..." class="nav-search-input" id="nav-search-input" autocomplete="off" value="${param.search_LIKE_name}" />
						<i class="ace-icon fa fa-search nav-search-icon" onclick="$('.form-search').submit();"></i>
					</span>
					<span class="input-icon">
						<select class="chosen-select form-control" autocomplete="off" name="search_EQ_ishot" data-placeholder="是否热门">
					        <option value="" selected="selected">请选择</option>
							<option value="0" <c:if test="${param.search_EQ_ishot eq '0' }">selected="selected"</c:if>>普通</option>
							<option value="1" <c:if test="${param.search_EQ_ishot eq '1' }">selected="selected"</c:if>>热门</option>
						</select>
					</span>
					<span class="input-icon">
					    <select class="chosen-select form-control" name="search_EQ_deltag" data-placeholder="请选择状态">
					        <option value="" selected="selected">请选择</option>
							<option value="0" <c:if test="${param.search_EQ_deltag eq '0' }">selected="selected"</c:if>>可用</option>
							<option value="1" <c:if test="${param.search_EQ_deltag eq '1' }">selected="selected"</c:if>>不可用</option>
						</select>
					</span>
					<input type="button" value="搜索" onclick = "$('.form-search').submit();" />
				</form>
			</div>
	
		</div>	
		
		<div class="page-content">
			
			<c:if test="${not empty message}">
				<div id="message" class="alert alert-success"><button data-dismiss="alert" class="close">×</button>${message}</div>
			</c:if>	
			
			<div class="page-header">
				<h1>
					消息
					<small>
						<i class="ace-icon fa fa-angle-double-right"></i>
						列表
					</small>
				</h1>
				
			</div>		
			
			<div class="row">
				<div class="col-xs-12">
					
					<table id="sample-table-1" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th class="center">
									<label class="position-relative">
										<input type="checkbox" id="id-toggle-all" class="ace" />
										<span class="lbl"></span>
									</label>
								</th>
								<th>内容</th>
								<th>姓名</th>
								<th>创建时间</th>
								<th>状态</th>
								<th>管理</th>
							</tr>
						</thead>

						<tbody>
							<c:forEach items="${msgs.content}" var="msg">
							<tr>
								<td class="center">
									<label class="position-relative">
										<input type="checkbox" class="ace" />
										<span class="lbl"></span>
									</label>
								</td>

								<td>
									${msg.truckMessage.msg}
								</td>	
								
								<td>
									${msg.customor.user.name}
								</td>	
								
								
								
								<td>
									<fmt:formatDate value="${msg.createdate}" pattern="yyyy年MM月dd日  HH时mm分ss秒" />
								</td>
								
								<td>
									<c:if test="${msg.deltag eq '0' }">正常</c:if>
									<c:if test="${msg.deltag eq '1' }">已删除</c:if>
								</td>	
									
								<td>
									<a class="btn btn-xs btn-danger" href="${ctx}/msg/delete/${msg.id}">
										删除
									</a>
								</td>
																	
							</tr>
							</c:forEach>
						</tbody>
					</table>
							
				</div>
			</div>
			
			<tags:pagination page="${msgs}" paginationSize="5"/>
		
			<div style="clear:right"><a class="btn btn-info" href="${ctx}/msg/create">发布消息</a></div>
		</div><!-- /.page-content -->
	</div>
</body>
</html>	